const search = require('../service/search')

const searchList = async(ctx)=>{
    let res1 = await search.searchBook(ctx.query)
    let res2 = await search.searchDoctor(ctx.query)
    let res3 = await search.searchSoco(ctx.query)
    return ctx.body = {
        code:20000,
        data:{
            book:res1,
            doctor:res2,
            soco:res3
        },
        msg:"搜索成功"
    }
}

const searchAdmin = async(ctx)=>{
    let res = await search.searchAdmin(ctx.query)
    return ctx.body = {
        code:20000,
        data:res,
        msg:"搜索成功"
    }
}

module.exports = {
    searchList,
    searchAdmin
}